#include "struct.h"
#include "function.h"

/**
 * @brief 通过传址调用销毁链表，最后修改其值为空
 * 
 * @param list 链表的地址
 */
void exit_func(p_node *list)
{
    p_node current = *list;
    while(current != NULL)
    {
        p_node next = current->next;
        free(current);
        current = next;
    }

    *list = NULL;       //最后将头指针指向空
}